package com.ruoyi.moon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.moon.mapper.MoonLeaveMessageMapper;
import com.ruoyi.moon.domain.MoonLeaveMessage;
import com.ruoyi.moon.service.IMoonLeaveMessageService;

/**
 * 留言反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-16
 */
@Service
public class MoonLeaveMessageServiceImpl implements IMoonLeaveMessageService 
{
    @Autowired
    private MoonLeaveMessageMapper moonLeaveMessageMapper;

    /**
     * 查询留言反馈
     * 
     * @param id 留言反馈主键
     * @return 留言反馈
     */
    @Override
    public MoonLeaveMessage selectMoonLeaveMessageById(Long id)
    {
        return moonLeaveMessageMapper.selectMoonLeaveMessageById(id);
    }

    /**
     * 查询留言反馈列表
     * 
     * @param moonLeaveMessage 留言反馈
     * @return 留言反馈
     */
    @Override
    public List<MoonLeaveMessage> selectMoonLeaveMessageList(MoonLeaveMessage moonLeaveMessage)
    {
        return moonLeaveMessageMapper.selectMoonLeaveMessageList(moonLeaveMessage);
    }

    /**
     * 新增留言反馈
     * 
     * @param moonLeaveMessage 留言反馈
     * @return 结果
     */
    @Override
    public int insertMoonLeaveMessage(MoonLeaveMessage moonLeaveMessage)
    {
        moonLeaveMessage.setCreateTime(DateUtils.getNowDate());
        return moonLeaveMessageMapper.insertMoonLeaveMessage(moonLeaveMessage);
    }

    /**
     * 修改留言反馈
     * 
     * @param moonLeaveMessage 留言反馈
     * @return 结果
     */
    @Override
    public int updateMoonLeaveMessage(MoonLeaveMessage moonLeaveMessage)
    {
        return moonLeaveMessageMapper.updateMoonLeaveMessage(moonLeaveMessage);
    }

    /**
     * 批量删除留言反馈
     * 
     * @param ids 需要删除的留言反馈主键
     * @return 结果
     */
    @Override
    public int deleteMoonLeaveMessageByIds(Long[] ids)
    {
        return moonLeaveMessageMapper.deleteMoonLeaveMessageByIds(ids);
    }

    /**
     * 删除留言反馈信息
     * 
     * @param id 留言反馈主键
     * @return 结果
     */
    @Override
    public int deleteMoonLeaveMessageById(Long id)
    {
        return moonLeaveMessageMapper.deleteMoonLeaveMessageById(id);
    }
}
